# CORI Provider-Facing Live Transport Scaffold ## Purpose This document defines the first provider-facing transport scaffold for CORI Live Call Copilot. The goal is to keep Twilio or any future provider outside the dispatcher-facing UI contract. The dispatcher should only see one calm runtime model across the full page and popup surfaces. ## Core rule Provider payloads must not become the UI state model. Instead the flow should be: 1. provider event arrives 2. adapter normalizes the payload 3. normalized event enters the shared CORI runtime spine 4. page and popup both read the same posture, facts, advice, and save boundary ## Adapter boundaries The provider adapter layer owns: - raw provider event names - raw transcript/media payload shape - provider session ids and webhook payloads - provider connection and transport quirks The shared CORI runtime owns: - normalized event types - listening posture - consent / policy gate state - partial fact lifecycle - advice refresh timing - save-readiness ## Session start guards A provider-backed session must stay blocked or waiting until these are satisfied: - workspace policy allows live listening work - notice / consent posture is satisfied - a real phone target exists - browser dialer session is connected when required - provider mapping is available - webhook/base URL posture is known - live token posture is ready for controlled rollout ## Provider-to-runtime bridge The first bridge path should map provider events into the existing normalized runtime spine: - session create -> `SESSION_READY` - provider dialing/ringing -> `CALL_DIALING` - provider answer/media ready -> `CALL_CONNECTED` - provider partial transcript/media cue -> `TRANSCRIPT_PARTIAL` - provider completion/webhook outcome -> `SESSION_ENDED` Then the normal fact, advice, and save-boundary logic continues exactly as it already does in the mock runtime. ## Mock-to-provider swap points The intended swap points are: - mock runtime feed -> provider event bridge - simulated transcript fragments -> normalized provider transcript intake - local call-start state -> consent-guarded provider session create - mock closeout/save boundary -> provider completion + stable fact handoff ## UI rule The full page and popup must remain on one normalized live event spine. No provider-specific UI state should be introduced in only one surface. ## Near-term follow-up The next build should harden the provider session bridge and begin controlled event normalization around the existing Twilio transport endpoints.